<style lang="scss" scoped>
@import './src/common/scss/base-style';
@import '/static/bootstrap/bootstrap.min.css';
@import '/static/bootstrap/style.css';
#family-home {
    height: 100%;
    background: #F5F7F9;
    .clearfix {
        display: block;
        float: none;
        clear: both;
        overflow: hidden;
        width: auto;
        height: 0;
        margin: 0 auto;
        padding: 0;
        font-size: 0;
        line-height: 0;
    }
    .parent {
        overflow: hidden;
        margin-bottom: -68px;
        padding-bottom: 68px;
        height: 100%;
        .left {
            float: left;
            width: 100%;
        }
        .content {
            height: 100%;
            overflow: auto; // margin-left: 230px;
        }
    }
}
</style>

<template>
    <div id="family-home">
        <ad-header @isLogFn="listLogFn"></ad-header>
        <div class="parent">
            <Sider ref="side1" hide-trigger width='230' collapsible collapsed-width="65" v-model="isCollapsed">
                <div class="left">
                    <ad-left :collapse='isCollapsed'></ad-left>
                </div>
            </Sider>
            <Layout style="height:100%;">
                <div class="content">
                    <router-view></router-view>
                </div>
            </Layout>
        </div>
        <div class="clearfix"></div>
    </div>
</template>
<script>
import adLeft from '@/components/familyLeft.vue';
import adHeader from '@/components/rareHeader.vue';
import { setCookie, getCookie, delCookie } from '@/common/js/cookie.js';
export default {
    name: "family-home",
    data() {
        return {
            isCollapsed: false
        }
    },
    components: {
        adHeader,
        adLeft
    },
    methods: {
        listLogFn() {
            this.$refs.side1.toggleCollapse();
        }
    },
    created() {
        this.$store.state.username = getCookie('username')
        this.$store.state.token = getCookie('token');
        $ajax.defaults.headers.common['Authorization'] = this.$store.state.token;
    }
}
</script>
